'''
author:mzy
time:16:24
date:2022/8/24
'''
import requests

def req_methods(u,p,c):
# def req_methods():
    resp_v = requests.get(url="http://127.0.0.1/index.php?m=Home&c=User&a=verify&r=0.7328677362022877")
    # print(resp_v)
    my_cookies = resp_v.cookies
    resp = requests.post(url="http://127.0.0.1/index.php?m=Home&c=User&a=do_login&t=0.15230652936282052",
                     # data={"username":"13548403728","password":"1234567890","verify_code":"8888"},
                    data={"username":{u},"password":{p},"verify_code":{c}},
                     cookies=my_cookies)

    msg =  resp.json()["msg"]
    # print(msg)
    # print(resp.json())
    return msg

# def ses_methods(s,u,c,po,pt):
def ses_methods():
    session = requests.session()
    session.get(url="http://127.0.0.1/index.php?m=Home&c=User&a=verify&type=user_reg&r=0.030215623215508858")
    resp = session.post(url="http://127.0.0.1/Home/User/reg.html",
                         headers={"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
                         data={"scene":"1","username":"13578963456","verify_code":"8888","password":"1234567890","password2":"1234567890"})
                         # data = {"scene": {s} "username": {u}, "verify_code": {c}, "password": {po},"password2": {pw}})
    msg = print(resp.json()["msg"])
    return msg
# req_methods()
# print(type(req_methods("13548403728","1234567890","8889")))